<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <t-popup
      class="placement bottom center"
      attach="#attach"
      content="查看本单元全景展厅"
      placement="bottom"
      showArrow
      destroyOnClose
    >
      <img
        v-if="props.info.digitalShowroom"
        class="icon-3d blinking-animation-style"
        id="outlineIcon"
        @click="open(props.info.digitalShowroom)"
        :src="publicUrls + 'free/style1/3dIcon.png'"
      />
    </t-popup>
    <img class="outline-parent-bg" :src="publicUrls + 'free/style1/Level1outlineStyle3Bg.webp'" alt="" />
    <div class="outline jy-style-height">
      <div class="outline-content" :style="!props.info.subTitle && !props.info.remarks && { justifyContent: 'center' }">
        <p class="content-tiitle">{{ props.info.text }}</p>
        <p class="outline-subTitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
        <img
          v-if="props.info.value"
          @click="ImgVisible = true"
          class="cover-bg"
          :class="{ 'cover-no': !props.info.remarks }"
          :src="urls + props.info.value + '?imageView2/3/format/webp'"
          alt=""
        />
        <TextMax
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="props.info.value ? 5 : 16"
        ></TextMax>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'style3',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';

const store = useProjectStore();
const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-top: 0;
  margin-right: 280px;
}
.outline-parent-bg {
  width: 675px;
  height: 100%;
}
.icon-3d {
  width: 52px;
  height: 64px;
  object-fit: contain;
  position: absolute;
  top: 19px;
  right: 70px;
  z-index: 21;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  width: 100%;
}
.outline-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 448px;
  height: calc(100%);
  margin-left: 155px;
}
.content-tiitle {
  margin-top: 70px;
  font-family: SourceHanSerifCN-Bold;
  font-size: 32px;
  line-height: 48px;
  text-align: center;
  color: rgba(50, 43, 37, 1);
  text-shadow: 0px 4px 4px 0px rgba(108, 92, 79, 0.25);
  margin-bottom: 18px;
}
.outline-subTitle {
  width: 448px;
  text-align: center;
  font-family: SourceMedium;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  margin-bottom: 30px;
  color: rgba(50, 43, 37, 1);
}
.outline-remarks {
  width: 448px;
  :deep(.openText) {
    justify-content: center;
    // font-family: PingFang SC;
    // font-size: 16px;
    // font-weight: 400;
    // line-height: 32px;
    color: rgba(85, 59, 42, 1);
    span {
      color: rgba(85, 59, 42, 1);
    }
  }
  :deep(.text p) {
    color: rgba(50, 43, 37, 1);
  }
  :deep(.omission) {
    color: rgba(50, 43, 37, 1);
  }
}

.cover-bg {
  width: 370px;
  height: 370px;
  object-fit: contain;
  background: rgba(244, 205, 134, 0.2);
  border: 4px solid #6c5c4f;
  margin-bottom: 20px;
  //   width: auto;
  //   height: auto;
  // box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
}
.cover-no {
  height: 546px;
}
::v-deep .t-popup__content {
  background: #886c56;
  padding: 2px 12px;
  font-family: 'Microsoft YaHei';
  font-size: 13px;
  line-height: 20px;
  color: #fef3df;
  box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
  margin-top: 6px !important;
}
::v-deep .t-popup__arrow::before {
  background: #886c56;
  border: none;
  box-shadow: none !important;
}
</style>